﻿using CommonTools;
using CommonTools.Controls;
using shop.Bll.BasicInfo;
using shop.Bll.cost;
using shop.Bll.trade;
using shop.Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Threading.Tasks;

namespace shop
{
    /// <summary> 店铺 </summary>
    public class ShopBllUI : ShopBll
    {
        private ControlBuilder _builder;

        public override ControlBuilder GetUIBuilder()
        {
            _builder = base.GetUIBuilder()
                .SetFlowBreak()
                .AddButton("从旺店通同步", ImportDataFromWdt, true);

            return _builder;
        }

        /// <summary> 导入 </summary>
        public async Task<PageButtonResult> ImportDataFromWdt()
        {

            //从旺店通查询
            var list = await base.QueryShopFromWdt();

            //同步
            await SyncTo(list);

            return new PageButtonResult(ResultCode.Ok, "导入完成!", true );

        }




    }
}
